/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.lczyfz.wisdom.modules.platform.entity;

import com.lczyfz.wisdom.common.persistence.DataEntity;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import java.util.ArrayList;
import java.util.List;

/**
 * 省市区地址Entity
 * @author zkh
 * @version 2019-11-11
 */
public class SysRegion extends DataEntity<SysRegion> {
	
	private static final long serialVersionUID = 1L;
	@ApiModelProperty(value = "父节点id",name = "parent",example = "928293782")
	private String parent;		// 父节点id
	@ApiModelProperty(value = "区域名称",name = "name",example = "928293782")
	private String name;		// 区域名称
	@ApiModelProperty(value = "类型 0国家,1省份 2地市 3 区县",name = "type",example = "928293782")
	private String type;		// 类型 0国家,1省份 2地市 3 区县

	private List<SysRegion> childList = new ArrayList<SysRegion>();//查询使用

	public SysRegion() {
		super();
	}

	public SysRegion(String id){
		super(id);
	}

	@Length(min=1, max=32, message="父节点id长度必须介于 1 和 32 之间")
	public String getParent() {
		return parent;
	}

	public void setParent(String parent) {
		this.parent = parent;
	}
	
	@Length(min=1, max=120, message="区域名称长度必须介于 1 和 120 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=1, max=1, message="类型 0国家,1省份 2地市 3 区县长度必须介于 1 和 1 之间")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public List<SysRegion> getChildList() {
		return childList;
	}

	public void setChildList(List<SysRegion> childList) {
		this.childList = childList;
	}
}